<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>{if !empty($system.web_site_title)}{$system.web_site_title}{/if}</title>
    <link rel="icon" href="{if !empty($system.web_site_logo)}{$system.web_site_logo}{/if}">
    <link rel="stylesheet" href="/static/res/layui/css/layui.css">
    <link rel="stylesheet" href="/static/index/css/sign.css">
</head>
<body>
<img src="/static/index/img/icon90.png" alt="" class="back" onclick="load_href('{:url(\'user/index\')}',2)">
<div>
    <img src="/static/index/img/icon86.png" alt="" class="top-bg">
    <div class="content">
        <div class="date flex">
            <img src="/static/index/img/icon87.png" alt="">
            <div class="date-box">
                <div class="continuous flex">连续签到 <span class="always_day">{$always_day}</span> 天</div>
                <div class="TheCumulative flex">累计签到 <span class="sign_day">{$sign_day}</span> 天</div>
            </div>
        </div>
        <div class="bg">
            <div class="selectTime flex-center">
                <img src="/static/index/img/icon91.png" alt="" onclick="location.href='{:url(\'sign/index\')}?date={$reduce}'">
                <span>{$date}</span>
                <img src="/static/index/img/icon92.png" alt="" onclick="location.href='{:url(\'sign/index\')}?date={$plus}'">
            </div>
            <div class="weeks flex-layout">
                {foreach name="week" item="vo"}
                <div>{$vo}</div>
                {/foreach}
            </div>
            <div class="day flex">
                {foreach name="month" item="vo" key="key"}
                <?php $key = array_search($vo['week'],$week);?>
                {if $vo['day'] == 1}
                <?php for($i=1;$i<=$key;$i++){?>
                <div class="color1 flex-center">
                    <div></div>
                </div>
                <?php }?>
                {/if}
                <div class="{if $vo.status == 3}color2 {else}color1 {/if} {if $vo.status == 1}active{/if} flex-center">
                    <div>{$vo['day']}</div>
                </div>
                {/foreach}
            </div>
            {if $is_day_sign}
            <div class="btn" style="background: #9F9F9F">今日已签到</div>
            {else}
            <div class="btn signAdd">立即签到</div>
            {/if}
        </div>
    </div>
</div>
<div class="modal flex-center" style="display: none;">
    <div>
        <div class="bg">
            <img src="/static/index/img/icon89.png" alt="">
            <div class="text">
                <div class="integral flex-center"></div>
                <div class="signIn flex-center">已连续签到 <span class="always_day"></span>天</div>
            </div>
            <!-- 确认按钮 -->
            <div class="btn-3"></div>
        </div>
        <div class="flex-center">
            <img src="/static/index/img/icon88.png" alt="" class="close">
        </div>
    </div>
</div>
</body>
<script src="/static/index/js/jquery.js"></script>
<script src="/static/index/js/flexible.js"></script>
<script src="/static/res/layui/layui.js"></script>
<script src="/static/index/js/common.js"></script>
<script>
    $(function () {
        $(".reduce").click(function (){
            location.href = '{:url("sing/index")}?data=reduce';
        });
        $('.close').click(function () {
            location.reload();
        });
        $('.btn-3').click(function () {
            location.reload();
        });
        $('.signAdd').click(function () {
            layer.msg('<div><i class="layui-icon layui-icon-loading-1 layui-anim layui-anim-rotate layui-anim-loop"></i> 加载中...', {
                shade: 0.8,
                time: 99999
            });
            $.ajax({
                type: 'POST',
                url: '{:url("sign/add")}',
                dataType: "json",
                success: function (data) {
                    layer.closeAll();
                    if(data.code == 1){
                        $(".integral").html(data.msg);
                        $(".always_day").html(data.data.always_day);
                        $(".sign_day").html(data.data.sign_day);
                        $('.modal').show();
                    }else{
                        layer.msg(data.msg);
                    }
                }
            });
        });
    });
</script>
</html>